Editing String type attribute

using dxl scripting how to edit the stypr type attribute text.
More detail :
I have a columns "regression", "build", "result", "evidance" and "result comment" where as "regression", "build" and "result" are enumerated type and "evidance" and "result comment" are string type. I need a scipt to clear the contents of the columns "result", "evidance" and "result comment" for those "build" column value is = 100.
can any please guide me to edit the string type column text.
sireeshap - Tue Sep 06 01:00:48 EDT 2011

Re: Editing String type attribute
sireeshap - Tue Sep 06 02:46:37 EDT 2011

type error in previous question.
Using DXL scripting how to edit the string type attribute text.
More detail :
I have a columns "regression", "build", "result", "evidance" and "result comment" where as "regression", "build" and "result" are enumerated type and "evidance" and "result comment" are string type. I need a script to clear the contents of the columns "result", "evidance" and "result comment" for those "build" column value is = 100.
Attachments

attachment_14679570_detail.JPG

Re: Editing String type attribute
Mathias Mamsch - Tue Sep 06 03:42:12 EDT 2011

sireeshap - Tue Sep 06 02:46:37 EDT 2011
type error in previous question.
Using DXL scripting how to edit the string type attribute text.
More detail :
I have a columns "regression", "build", "result", "evidance" and "result comment" where as "regression", "build" and "result" are enumerated type and "evidance" and "result comment" are string type. I need a script to clear the contents of the columns "result", "evidance" and "result comment" for those "build" column value is = 100.

Do you really need a script for that? Because it is pretty easy to do it manually. Just create a filter "build = 100". Then right click any object, goto object properties / attributes, choose the attribute to clear, go to edit, select the option "Objects in current view" and then press "Reset to default". Just repeat that for all the attributes you want to clear. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Editing String type attribute
sireeshap - Tue Sep 06 03:53:59 EDT 2011

Mathias Mamsch - Tue Sep 06 03:42:12 EDT 2011
Do you really need a script for that? Because it is pretty easy to do it manually. Just create a filter "build = 100". Then right click any object, goto object properties / attributes, choose the attribute to clear, go to edit, select the option "Objects in current view" and then press "Reset to default". Just repeat that for all the attributes you want to clear. Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Hi Mathias Mamsch,

Thank you very much for immediate responce. presetly I am doing that manually. while performing regression execution, if the test cases are more , i have to spend more time for that. so we are looking script for that.
Could you please guide me in that.

Regards,
Sireesha

Re: Editing String type attribute
Mathias Mamsch - Tue Sep 06 06:24:31 EDT 2011

sireeshap - Tue Sep 06 03:53:59 EDT 2011
Hi Mathias Mamsch,

Thank you very much for immediate responce. presetly I am doing that manually. while performing regression execution, if the test cases are more , i have to spend more time for that. so we are looking script for that.
Could you please guide me in that.

Regards,
Sireesha

I do not see how more test cases will increase the time, since the procedure I described will do that for ALL objects in the current view in one click. Anyway the code would look something like this (try this in a test environment first, i did not test the code):
 

Object o 
if (!confirm "This script will delete stuff from your module, are you sure??") halt
for o in entire current Module do {
   // ignore deleted objects, table cells, table rows or table heads
   if (isDeleted o || cell o || table o || row o) continue
   
   if (o."build" "" == "100") {
      o."result" = ""
      o."evidence" = ""
      o."result comment" = ""
   }
}

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Editing String type attribute
sireeshap - Wed Sep 07 02:26:27 EDT 2011

Mathias Mamsch - Tue Sep 06 06:24:31 EDT 2011

I do not see how more test cases will increase the time, since the procedure I described will do that for ALL objects in the current view in one click. Anyway the code would look something like this (try this in a test environment first, i did not test the code):
 

Object o 
if (!confirm "This script will delete stuff from your module, are you sure??") halt
for o in entire current Module do {
   // ignore deleted objects, table cells, table rows or table heads
   if (isDeleted o || cell o || table o || row o) continue
   
   if (o."build" "" == "100") {
      o."result" = ""
      o."evidence" = ""
      o."result comment" = ""
   }
}

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Hi Mathias ,

This code is not working. after entering into last if loop it's throughing" DXL halted with run tume error". could you please look this again.

Re: Editing String type attribute
Mathias Mamsch - Wed Sep 07 04:05:31 EDT 2011

sireeshap - Wed Sep 07 02:26:27 EDT 2011
Hi Mathias ,

This code is not working. after entering into last if loop it's throughing" DXL halted with run tume error". could you please look this again.

I think it is dangarous applying DXL without a little knowledge of the workings. Did you respect the following points:

  • The script must be started from the module to which you want to apply the script using "Tools / Edit DXL"
  • The module must be opened in exclusive edit mode
  • Make sure the spellings of the attributes is correct! I wondered that evidance is written with 'a' instead of 'e' therefore I corrected that in the script, but I noticed that in the screenshot the column is also named "evidance".
  • Make sure in the 'Edit Attributes' dialog, that the attributes that the script tries to clear are indeed normal attributes (not DXL Attributes) and that you have write access to them.


If that does not resolve the problem, you need to post the exact error message from dxl like:

 

-R-E- DXL: <Line:7> unknown Object attribute (build)
-I- DXL: execution halted


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: Editing String type attribute
sireeshap - Wed Sep 07 05:44:38 EDT 2011

Mathias Mamsch - Wed Sep 07 04:05:31 EDT 2011

I think it is dangarous applying DXL without a little knowledge of the workings. Did you respect the following points:

  • The script must be started from the module to which you want to apply the script using "Tools / Edit DXL"
  • The module must be opened in exclusive edit mode
  • Make sure the spellings of the attributes is correct! I wondered that evidance is written with 'a' instead of 'e' therefore I corrected that in the script, but I noticed that in the screenshot the column is also named "evidance".
  • Make sure in the 'Edit Attributes' dialog, that the attributes that the script tries to clear are indeed normal attributes (not DXL Attributes) and that you have write access to them.


If that does not resolve the problem, you need to post the exact error message from dxl like:

 

-R-E- DXL: <Line:7> unknown Object attribute (build)
-I- DXL: execution halted


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Hi Mathias,

Thanks alot. Finally my script is working with your guidance.

Object o
if (!confirm "This script will delete stuff from your module, are you sure??") halt

for o in entire current Module do {
// ignore deleted objects, table cells, table rows or table heads
if (isSelected o || cell o || table o || row o) continue

if (o."Build" "" == "10"){

if (isSelected o || cell o || table o || row o) continue
o."Regression" = "No"

o."TestEvidance" = ""
}
}

Thank you very much.

regards,
sireesha. P

Re: Editing String type attribute
llandale - Wed Sep 07 13:17:36 EDT 2011

sireeshap - Wed Sep 07 05:44:38 EDT 2011
Hi Mathias,

Thanks alot. Finally my script is working with your guidance.

Object o
if (!confirm "This script will delete stuff from your module, are you sure??") halt

for o in entire current Module do {
// ignore deleted objects, table cells, table rows or table heads
if (isSelected o || cell o || table o || row o) continue

if (o."Build" "" == "10"){

if (isSelected o || cell o || table o || row o) continue
o."Regression" = "No"

o."TestEvidance" = ""
}
}

Thank you very much.

regards,
sireesha. P

So you don't want to erase the data for objects associated with a table. I see you are also bypassing objects that are currently selected by the user. Usually you indeed DO make changes when its selected instead of making changes to everything else.

Perhaps you intend "if (! isSelected o ..."
Perhaps you intend "isDeleted o" instead of "isSelected o".
You don't need the 2nd continue line as you've already bypassed those objects.

  • Louie

I'd be tempted to add a counter of modified objects and display that at the end.

infoBox("Regression and Evidence erased for " CountObjs " build-10 objects")